package cn.kgc.utils;

import java.util.Calendar;

public class OrderNoUtils {
    public static  String getOrderNo(){
        Calendar calendar=null;
        calendar=Calendar.getInstance();
        int year=calendar.get(calendar.YEAR);
        int month=calendar.get(calendar.MONTH)+1;
        int day=calendar.get(calendar.DATE);
        int hour = calendar.get(Calendar.HOUR_OF_DAY);
        int minute = calendar.get(Calendar.MINUTE);
        int second = calendar.get(Calendar.SECOND);
        int end= (int)((Math.random()*9+1)*1000000);

        String endStr=String.valueOf(end);
        String out_trade_no = "MH"+String.valueOf(year)+String.valueOf(month)+String.valueOf(day)+String.valueOf(hour)+String.valueOf(minute)+String.valueOf(second)+endStr;
        return out_trade_no;

 }
}
